import { join } from 'path';
import Database from 'better-sqlite3';
import { app } from 'electron';
import { ensureDir } from '../utils';
import type * as BetterSqlite3 from 'better-sqlite3';

const appPath = join(app.getPath('home'), '.f-tools')
ensureDir(appPath)
const file = join(appPath, 'f-tools.db')
const db: BetterSqlite3.Database = new Database(file, {});
db.pragma('journal_mode = WAL');

export { db, appPath }
